<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.DriverManager" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/4/3
  Time: 20:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>后台修改信息页面</title>
</head>
<body>
<%
    String id = request.getParameter("id");
    String username = request.getParameter("username");
    String password = request.getParameter("password");

    //3+1
    Connection connection = null;
    Statement statement = null;

    String sql = "UPDATE t_users " +
            "SET  username = '"+username+"',password='"+password+"'" +
            "WHERE id="+id+"";
//    out.write(request.getParameter("id"));
//    out.write(id+username+password);
    Class.forName("com.mysql.jdbc.Driver");

    connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/sctu_javaweb_2018?serverTimezone=UTC",
            "root",
            "123456");

    statement = connection.createStatement();

    statement.execute(sql);

    statement.close();
    connection.close();

    out.write("修改成功！");
%>
</body>
</html>
